export class Question {
  id: string;
  num: number;
  content: string;
  type: boolean;
  options: any;
  isSelect: boolean;
  grade: number; //学生单题获取的分数
  isMultiple: boolean;

  constructor(id, num, content, type) {
    this.id = id;
    this.num = Number(num);
    this.content = content;
    this.type = Boolean(type);
    this.options = [];
    this.isSelect = false;//用户是否已经选择
    this.isMultiple = false;//是否属于多选
  }

  //添加题目
  addOption(content, grade, num) {
    let option = {content: content, grade: Number(grade), num: num};
    this.options.push(option);
  }

  //添加多选题目
  addMultipleOption(content, grade, num, checked) {
    let option = {content: content, grade: Number(grade), num: num, checked: checked};
    this.options.push(option);
  }
}
